<template>
  <div>
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      class="table_header_blue"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
      <span slot="actionName">
        <a-button
          v-if="stage !== '05010' && stage !== '05050'"
          size="small"
          @click="handleAdd('添加授权')"
          type="primary"
          icon="plus"
          >添加授权</a-button
        >
        <span v-else>操作</span>
      </span>
      <span v-if="stage !== '05010' && stage !== '05050'" slot="action" slot-scope="text, record">
        <a @click="handleEdit(record, '组间授权')">编辑</a>
        <a-divider type="vertical" />
        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
          <a>删除</a>
        </a-popconfirm>
      </span>
      <span slot="action" slot-scope="text, record" v-else>
        <a-button type="link" @click="handleCheck(record, '查看')">查看</a-button>
      </span>
    </a-table>
    <CheckAndEditModel ref="modalForm" :id="id" @ok="modalFormOk"></CheckAndEditModel>
  </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CheckAndEditModel from './CheckAndEditModel'

import columns from './indexColumns'

export default {
  props: ['id', 'stage'],
  name: 'sjcgzjsq',
  components: {
    CheckAndEditModel,
  },
  mixins: [JeecgListMixin],
  data() {
    return {
      //表头
      queryParam: {
        proId: this.id,
      },
      columns: columns(this),
      url: {
        list: '/sjxmzygl/sjWorkProjectPower/getPowerList',
        delete: '/sjxmzygl/sjWorkProjectPower/delete',
      },
    }
  },
}
</script>

<style lang="less" scoped>
@import '~@assets/less/tableTheme.less';
</style>